﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo01
{
    class Aniaml
    {
        private int leg;
        public int Leg
        {
            get { return this.leg; }
            set { this.leg = value; }
        }
        public void Walk()
        {
            Console.WriteLine("我会走路！");
        }

        public void Eat()
        {
            Console.WriteLine("我会吃！"); 
        }

        public void Sleep()
        {
            Console.WriteLine("我会睡觉！"); 
        }

        //虚方法
        public virtual void Cry()
        {
            Console.WriteLine("我要叫了！");    
        }

    }
}
